package com.leaf.lowcode.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.leaf.lowcode.entity.DoorevenDTO;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author cxd
 * @since 2021-11-21
 */
public interface AccessInoutMapper extends BaseMapper<DoorevenDTO> {
    @Select("select * from access_inout where event_id = #{eventId} and cert_no=#{certNo}")
    DoorevenDTO selectId(String eventId,String certNo);

    @Select("SELECT COUNT(*) FROM access_inout  WHERE  in_and_out_type=#{in_and_out_type} AND  event_time BETWEEN #{timestr} AND #{timeend} ")
    DoorevenDTO count(String eventId,String certNo);
}
